import { request } from './request'
// 获取用户列表
export function userApi (params) {
  return request({
    url: '/mgr/members',
    method: 'get',
    params
  })
}
// 新增用户
export function addUser (data) {
  return request({
    url: '/mgr/members',
    method: 'post',
    data
  })
}

// 更新用户
export function updateUser (data) {
  return request({
    url: '/mgr/members/' + data.id,
    method: 'put',
    data: {
      name: data.name,
      mobile: data.mobile
    }
  })
}

// 删除用户
export function deleteUser (data) {
  return request({
    url: '/mgr/members/' + data.id,
    method: 'delete',
    data: {
      username: data.username,
      name: data.name,
      password: data.password,
      mobile: data.mobile
    }
  })
}
